package com.betting.dto;

import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
public class BetRecordDTO {
    private Long id;

    @NotNull(message = "比赛时间不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm")
    private LocalDateTime betTime;

    private String betTimeStr;

    @NotBlank(message = "主队名称不能为空")
    @Size(max = 100, message = "主队名称不能超过100个字符")
    private String homeTeam;

    @NotBlank(message = "客队名称不能为空")
    @Size(max = 100, message = "客队名称不能超过100个字符")
    private String awayTeam;

    @NotBlank(message = "联赛名称不能为空")
    @Size(max = 50, message = "联赛名称不能超过50个字符")
    private String leagueName;

    @NotBlank(message = "比赛类型不能为空")
    private String betType;

    private String handicapTeam;

    @NotBlank(message = "盘口数值不能为空")
    private String handicapValue;  // 盘口数值

    @NotNull(message = "水位不能为空")
    @DecimalMin(value = "0.1", message = "水位必须大于0.1")
    @DecimalMax(value = "5.0", message = "水位不能超过5.0")
    private BigDecimal odds;

    @NotNull(message = "投注金额不能为空")
    @DecimalMin(value = "1", message = "投注金额必须大于1")
    private BigDecimal betAmount;

    private BigDecimal resultAmount = BigDecimal.ZERO;

    @Min(value = 0, message = "得分不能为负数")
    private Integer homeScore;

    @Min(value = 0, message = "得分不能为负数")
    private Integer awayScore;

    private String betResult;

    @Size(max = 255, message = "备注不能超过255个字符")
    private String note;
} 